# 数据清洗
import  pandas as pd
df = pd.read_excel("./movieinfo.xlsx")

def clearName (x):
    # 切片
    return x[:x.find(" ")]
df['电影名称'] = df["电影名称"].apply(clearName)
df['时长'] = df["时长"].apply(clearName)
df['上映时间'] = df["上映时间"].apply(clearName)
df.to_excel("./movieinfo_cleaned.xlsx",index=False)

